<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
        <head>
                <meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
                        <title>Document</title>
                        <link rel="stylesheet" href="__PUBLIC__/Css/bootstrap.min.css" />
                        <link rel="stylesheet" href="__PUBLIC__/Css/common.css" />
                        <jquery/>
                        <script type="text/javascript">
                                $(function() {
                                        var sel = $('select[name="combattrid[]"]');
                                        var len = sel.length;
                                        sel.change(function() {
                                                var param = {
                                                        'gid': {$hd.get.gid},
                                                        'combattrid': {}
                                                }
                                                for (var i = 0; i < len; i++) {
                                                        if (sel.eq(i).val() == 0) {
                                                                return false;
                                                        }
                                                        param.combattrid[i] = sel.eq(i).val();
                                                }
                                                $.ajax({
                                                        url: '__MODULE__' + '&m=Admin&c=GoodsList&a=check',
                                                        type: 'post',
                                                        data: param,
                                                        dataType: 'json',
                                                        success: function(data)
                                                        {
                                                                if (data == 0)
                                                                {
                                                                        $('.warning').html('该货品已存在！');
                                                                        for (var i = 0; i < len; ++i)
                                                                        {
                                                                                sel.eq(i).val(0);
                                                                        }
                                                                }
                                                        }
                                                });
                                        })
                                })
                        </script>
                        <style type="text/css">
                                body{
                                        margin-bottom: 100px;
                                        margin-top: 10px;
                                }
                                input[type=text]{
                                        margin-bottom: 0px;
                                }
                        </style>
        </head>
        <body>
                <div class="container-fluid">
                        <div class="row-fluid">
                                <div class="span12">

                                        <form action="" method='post'>
                                                <table class='table table-bordered table-hover'>
                                                        <tr>
                                                                <th>货品ID</th>
                                                                <foreach from="$standname" value="$v">
                                                                        <th width='200'>{$v.taname}</th>
                                                                </foreach>
                                                                <th>库存</th>
                                                                <th>货号</th>
                                                        </tr>
                                                        <!-- 如果已添加数目小于可能情况数目，才出现添加货品的输入框 -->
                                                        <tr class="info">
                                                                <td>修改货品</td>
                                                                        <foreach from='$comb' value='$v'>
                                                                                <td>
                                                                                        <span>{$v}</span>
                                                                                </td>
                                                                        </foreach>
                                                                <td>
                                                                        <input type="text" name='stock' value='{$nowGlist.stock}'/>
                                                                </td>
                                                                <td>
                                                                        <input type="text" name='number' value="{$nowGlist.number}" />
                                                                </td>
                                                        </tr>
                                                </table>
                                                <input type="hidden" name='glid' value='{$hd.get.glid}'/>
                                                <input type="hidden" name='goods_gid' value='{$hd.get.gid}'/>
                                                <input type="submit" value='修改货品' class="btn btn-primary"/>
                                        </form>

                                </div>
                        </div>
                </div>
        </body>
</html>